/**
 * 2018年12月18日下午7:16:19
 * @author 谢进财
 */
package com.baihang.project.ds.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baihang.framework.kit.ShiroKit;
import com.baihang.framework.service.BaseService;
import com.baihang.project.ds.dao.FangYuanDao;
import com.baihang.project.ds.model.FangYuanModel;

/**
 * @author whati
 *
 */
@Service
public class DingDanService extends BaseService {
	/*@Autowired
	private DingDanDao dao;*/
	@Autowired
	private FangYuanDao dao;
	
	public FangYuanModel getDingDan() {
		FangYuanModel  model = dao.queryForFangYuan(String.format("select * from room where D_Operation='%s' and D_state=2 limit 1",ShiroKit.getCurrentUser().getUserName() ));
		return model;
	}
	//重置房源状态，预定还原为未售
	public void reSetState() {
			dao.update(String.format("update room set D_state=0 where D_Operation='%s' and D_state=1", ShiroKit.getCurrentUser().getUserName()));
	}
}
